Of course.
The paintComponent
method can be modified to draw several dozen
snowflakes of random colors at random locations:
A counting loop controls how many flakes are drawn.
Construct a new Random
object and use its nextInt()
method.
The location and size of each flake is determined by:
x = rand.nextInt( width ); y = rand.nextInt( height ); size = rand.nextInt( 20 );
How many different colors are there in this picture?